home *** CD-ROM | disk | FTP | other *** search
Text File | 1988-12-28 | 34.0 KB | 1,399 lines |
- .KF:Gen.toc
- .R:E
- .W:96
- .H:...DML GEN UNIT Version 1.00...
- .H:...$$Day Mon D, YEAR$$ $$Z:MI A.M.$$ Page $$$...
- .H:
- .F:
- .F:... Copyright (c) 1989, by DML Software Inc. ...
- .X:8
-
- .K:GENERAL ROUTINES - CHANGES HIGHLIGHTS (VERSION 1.00)
- GENERAL ROUTINES - CHANGES HIGHLIGHTS (VERSION 1.00)
-
- 1/1/89 Initial Release
-
-
-
- .K:1) SYSTEM PROGRAMMING EXTENSIONS
- 1) SYSTEM PROGRAMMING EXTENSIONS
-
- NAME
- .K:Abend - Terminate a Program.
- Abend - Terminate a Program.
-
- SYNOPSIS
- PROCEDURE Abend (ExitCode : BYTE; ProcAddr : POINTER);
-
- Abend(250,NIL);
-
- DESCRIPTION
- This procedure halts execution of a program, and pinpoints the run time
- address of the source line causing the abend in much the same way as
- actual Turbo run time errors. The procedure displays the segmented
- hexidecimal address of the line containing the Abend statement if the
- ProcAddr parameter is NIL, otherwise the address displayed is the value
- passed in this parameter. The ExitCode parameter is passed directly to
- the Turbo Halt Procedure. Note that ExitCode is a byte and not a word,
- because the DOS batch file statement IF ERRORLEVEL only looks at the
- lower byte of a word value set by the Turbo HALT.
-
- SEE ALSO
-
- DEPENDS ON
-
- DIAGNOSTICS
-
- KNOWN RESTRICTIONS
- Since only 255 possible exit codes can be set, it is the users
- responsibility to pick values not used by standard Turbo run time errors.
-
- PARTIALLY OBSOLETED BY
- RunError - Actually totally obsolete but Abend is such a 'nice' piece of
- code it remains for at least eductaional purposes.
-
- UPDATE HISTORY
-
-
-
- NAME
- .K:CallProcedure - Invoke a simple procedure indirectly.
- CallProcedure - Invoke a simple procedure indirectly.
-
- SYNOPSIS
- PROCEDURE CallProcedure (ProcAddr : POINTER);
-
- {$F+} PROCEDURE Indirect; {$F-}
-
- CallProcedure(@Indirect);
-
- DESCRIPTION
- This procedure invokes another procedure indirectly. The parameter is
- the address of another procedure. This is very useful in setting up
- 'jump tables' of procedures.
-
- SEE ALSO
- CallProcedureX
-
- DEPENDS ON
-
- DIAGNOSTICS
-
- KNOWN RESTRICTIONS
- The invoked procedure must have no parameters, and must be compiled with
- the FAR model compiler directive.
-
- PARTIALLY OBSOLETED BY
- Generalized Procedure Variables and Parameters
-
- UPDATE HISTORY
-
-
-
- NAME
- .K:CallProcedureX - Invoke a complex procedure indirectly.
- CallProcedureX - Invoke a complex procedure indirectly.
-
- SYNOPSIS
- PROCEDURE CallProcedureX ( ProcAddr : POINTER;
- I1 : INTEGER;
- VAR S1 : STRING;
- VAR I2 : INTEGER);
-
- {$F+} PROCEDURE Indirect ( ProcAddr : POINTER;
- I1 : INTEGER;
- VAR S1 : STRING;
- VAR I2 : INTEGER); {$F-}
-
-
- CallProcedure(@Indirect,23,MyStr,MyInt);
-
- DESCRIPTION
- This procedure invokes another procedure indirectly. The parameter is
- the address of another procedure. This procedure allows passing of
- parameters unlike CallProcedure, but the number and type of parameters is
- 'locked in'; to invoke another type of procedure, another procedure
- similar to this one must be set up using the provided source code for
- inspiration.
-
- SEE ALSO
- CallProcedure
-
- DEPENDS ON
-
- DIAGNOSTICS
-
- KNOWN RESTRICTIONS
- The invoked procedure must match the number and type of parameters
- in the invoking call exactly, and must be compiled with the FAR model
- compiler directive.
-
- PARTIALLY OBSOLETED BY
- Generalized Procedure Variables and Parameters
-
- UPDATE HISTORY
-
-
-
- NAME
- .K:LongAddr - Returns the full twenty bit address of any memory location.
- LongAddr - Returns the full twenty bit address of any memory location.
-
- SYNOPSIS
- FUNCTION LongAddr (Seg, Ofs : WORD ): LONGINT;
-
- WRITELN ('The memory location of DataVar is: ',
- LongAddr(SEG(DataVar),OFS(DataVar)));
-
- DESCRIPTION
- LongAddr combines the Segment and Offset 16 bit values for any memory
- location into a single twenty bit value, and returns this value as a
- real number.
-
- SEE ALSO
-
- DEPENDS ON
-
- DIAGNOSTICS
-
- KNOWN RESTRICTIONS
-
- PARTIALLY OBSOLETED BY
-
- UPDATE HISTORY
-
-
-
- NAME
- .K:Same - Performs byte by byte comparison of two blocks of data.
- Same - Performs byte by byte comparison of two blocks of data.
-
- SYNOPSIS
- FUNCTION Same (VAR Var1, Var2 ;
- Len : WORD) : BOOLEAN;
-
- IF Same(Var1,Var2,128) THEN ...
-
- DESCRIPTION
- This routine compares two untyped variables byte by byte for a
- explicit length defined by the third parameter. If the blocks are
- identical, Same returns TRUE, otherwise Same returns FALSE.
-
- SEE ALSO
-
- DEPENDS ON
-
- DIAGNOSTICS
-
- KNOWN RESTRICTIONS
-
- PARTIALLY OBSOLETED BY
-
- UPDATE HISTORY
-
-
- .K:2) FILE I/O AND PROTECTION
- 2) FILE I/O AND PROTECTION
-
- NAME
- .K:ReadOnlyExist - Determine if a file exists.
- ReadOnlyExist - Determine if a file exists.
-
- SYNOPSIS
- FUNCTION ReadOnlyExist (FileName : STRING) : BOOLEAN;
-
- IF ReadOnlyExist('RECA.DAT') THEN DoIt;
-
- DESCRIPTION
- This routine determines if a file exists, in a similar manner to the
- routine Exist. The difference is that if a file is set to read only
- access, the routine Exist will erroneously report the file doesn't
- exist because Exist uses a Turbo Reset, which assumes DOS read/write
- access. ReadOnlyExist checks for the existance of a file by doing a
- DOS level file open with read only access.
-
- SEE ALSO
- Exist
-
- DEPENDS ON
-
- DIAGNOSTICS
-
- KNOWN RESTRICTIONS
-
- PARTIALLY OBSOLETED BY
- FileMode
-
- UPDATE HISTORY
-
-
- NAME
- .K:ReadOnlyGetAttr - Return the current access mode of a DOS file.
- ReadOnlyGetAttr - Return the current access mode of a DOS file.
-
- SYNOPSIS
- FUNCTION ReadOnlyGetAttr (FileName : STRING) : BOOLEAN;
-
- IF ReadOnlyGetAttr('RECA.DAT') THEN Doit;
-
- DESCRIPTION
- This routine returns TRUE if the specified file has read only access,
- and FALSE if the file has read/write access, or the DOS call to get
- the attribute failed.
-
- SEE ALSO
-
- DEPENDS ON
-
- DIAGNOSTICS
-
- KNOWN RESTRICTIONS
-
- PARTIALLY OBSOLETED BY
-
- UPDATE HISTORY
-
-
-
- NAME
- .K:ReadOnlySetAttr - Set the access mode of a DOS file.
- ReadOnlySetAttr - Set the access mode of a DOS file.
-
- SYNOPSIS
- FUNCTION ReadOnlySetAttr (FileName : STRING ; Flag : BOOLEAN) : INTEGER;
-
- IF ReadOnlySetAttr('RECA.DAT',TRUE) <> 0 THEN Doit;
-
- DESCRIPTION
- This routine sets or clears read only access for the specified file.
- The routine first gets the current file attributes, so the archive
- bit, used for file backups, isn't cleared.
-
- SEE ALSO
-
- DEPENDS ON
-
- DIAGNOSTICS
- If the set attribute fails, the DOS error number is returned in the
- function result, otherwise zero is returned.
-
- KNOWN RESTRICTIONS
-
- PARTIALLY OBSOLETED BY
-
- UPDATE HISTORY
-
-
-
- NAME
- .K:FileOpen - Open a DOS file.
- FileOpen - Open a DOS file.
-
- SYNOPSIS
- FUNCTION FileOpen (VAR GenFileDummy;
- GenFileRecLen : WORD
- GenFileOpenMode : WORD) : INTEGER;
-
- ASSIGN(MyFile,'MYDATA.DAT');
- IF FileOpen(MyFile,SIZEOF(MyFileBuf),Read_Only) <> 0 THEN DoIt;
-
- DESCRIPTION
- This routine 'replaces' the Turbo Reset and Rewrite commands and uses DOS
- level commands to open a file for processing. The record length for the
- file to be processed must be explicitly passed as a parameter, so the
- Turbo FileRec block can be set up correctly. This routine will work for
- any type of Turbo file other than text files. This routine is handy for
- a variety of purposes, mainly opening read-only files and/or files of any
- length.
-
- SEE ALSO
- FileAssignAndOpen
-
- DEPENDS ON
-
- DIAGNOSTICS
- If the file open fails, the DOS error number is returned in the
- function result, otherwise zero is returned.
- Formatted error message displayed if reclen of 0 passed.
-
- KNOWN RESTRICTIONS
- Doesn't work with text files.
-
- PARTIALLY OBSOLETED BY
- FileMode
-
- UPDATE HISTORY
-
-
-
- NAME
- .K:FileAssignAndOpen - Assign and Open a DOS file.
- FileAssignAndOpen - Assign and Open a DOS file.
-
- SYNOPSIS
- FUNCTION FileAssignAndOpen ( GenFileName : STRING;
- VAR GenFileDummy;
- GenFileRecLen : WORD
- GenFileOpenMode : WORD) : BOOLEAN;
-
- IF FileAssignAndOpen
- ('MYDATA.DAT',MyFile,SIZEOF(MyFileBuf),Read_Only) THEN DoIt;
-
- DESCRIPTION
- This routine is identical to FileOpen, except that it works at a slightly
- higher level. This routine does the file assign internally, instead of
- having to complete the assign before invoking the function. This routine
- also returns a Boolean value rather than an Integer error code.
-
- SEE ALSO
- FileOpen
-
- DEPENDS ON
-
- DIAGNOSTICS
- If the file open fails, the function result is False, otherwise TRUE is
- returned.
- Formatted error message displayed if reclen of 0 passed.
-
- KNOWN RESTRICTIONS
- Doesn't work with text files.
-
- PARTIALLY OBSOLETED BY
- FileMode
-
- UPDATE HISTORY
-
-
- .K:3) TEXT ENCRYPTION
- 3) TEXT ENCRYPTION
-
- NAME
- .K:EnCrypt - Encrypt a Text String.
- EnCrypt - Encrypt a Text String.
-
- SYNOPSIS
- FUNCTION EnCrypt (Orig : STRING) : STRING;
-
- Password := EnCrypt('Shhhh');
-
- DESCRIPTION
- This function provides a quick and dirty way of encrypting text; its
- primary purpose is for generation of simple passwords. The encryption
- algorithm is as follows:
- a) Binary one is added to the ASCII value of the last character in
- the string.
- b) Binary two is subtracted from the ASCII value of the second to last
- character in the string.
- c) Binary three is added to the ASCII value of the third to last
- character in the string.
- d) This add/subtract pattern is continued through the first
- character in the string.
- For the above example the string 'Shhhh' encrypts to 'Xdkfi'.
- Because Encrypt is used primarily for keyboard input of passwords, the
- encrypted characters must be typable from the keyboard, i.e. in the ASCII
- range of 33 to 126 ('!' to '~'). Note that the space character (ASCII
- 32) is also not a valid encrypted character because it would split
- passwords in two. If a non typable character is generated, the resultant
- function value is set to the null string. Note that the likelyhood of
- generating a non typable character increases as the length of the input
- string increases. There are currently no plans to await DOD sponsorship
- of this algorithm.
-
- SEE ALSO
- DeCrypt
-
- DEPENDS ON
- Odd
-
- DIAGNOSTICS
-
- KNOWN RESTRICTIONS
- Restrict string to typable characters, see description above.
-
- PARTIALLY OBSOLETED BY
-
- UPDATE HISTORY
-
-
-
- NAME
- .K:Decrypt - Decrypt a Text String.
- DeCrypt - Decrypt a Text String.
-
- SYNOPSIS
- FUNCTION DeCrypt (Orig : STRING) : STRING;
-
- OriginalValue := DeCrypt(Password);
-
- DESCRIPTION
- This function provides a quick and dirty way of decrypting text
- encrypted by the function Encrypt. It runs the encryption algorithm
- backwards, to generate the original value passed to the Encrypt
- routine. For the above example the string 'Xdkfi' decrypts to
- 'Shhhh'.
-
- SEE ALSO
- Encrypt
-
- DEPENDS ON
- Odd
-
- DIAGNOSTICS
-
- KNOWN RESTRICTIONS
- Restrict string to typable characters, see Encrypt.
-
- PARTIALLY OBSOLETED BY
-
- UPDATE HISTORY
-
-
- .K:4) GENERAL PURPOSE VIDEO
- 4) GENERAL PURPOSE VIDEO
-
- NAME
- .K:GenBeep - Sounds the PC speaker.
- GenBeep - Sounds the PC speaker.
-
- SYNOPSIS
- PROCEDURE GenBeep (Frequency, Duration : WORD);
-
- GenBeep (0,0); - produces the default beep;
- GenBeep (1600, 20); - produces high pitch shorter beep;
-
- DESCRIPTION
- GenBeep will provide a default beep if a zero is passed as both
- parameters. If a different frequency is desired only the frequency needs
- to be specified, with a zero for the duration. The same is true for
- duration.
-
- SEE ALSO
-
- DEPENDS ON
-
- DIAGNOSTICS
-
- KNOWN RESTRICTIONS
-
- PARTIALLY OBSOLETED BY
-
- UPDATE HISTORY
-
-
- NAME
- .K:ColorMonitorInstalled - Test if a color monitor is installed.
- ColorMonitorInstalled - Test if a color monitor is installed.
-
- SYNOPSIS
- FUNCTION ColorMonitorInstalled : BOOLEAN;
-
- IF ColorMonitorInstalled THEN TextColor (Blue);
-
- DESCRIPTION
- The function ColorMonitorInstalled will return a true value if the
- display card is set for color mode.
-
- SEE ALSO
-
- DEPENDS ON
-
- DIAGNOSTICS
-
- KNOWN RESTRICTIONS
- ColorMonitorInstalled will only work for IBM cards. It will work for
- a Hercules card if the base of the card is set for $b000 - Monochrome.
- (The hercules card can be set several ways.) The procedure is
- actually misnamed since there is no software command to check that
- the monitor is actually color! (You can hook a b/w monitor to a color
- card.)
-
- PARTIALLY OBSOLETED BY
- DetectGraph
-
- UPDATE HISTORY
-
-
- NAME
- .K:Cursor - Turns the cursor on or off.
- Cursor - Turns the cursor on or off.
-
- SYNOPSIS
- PROCEDURE Cursor (Visible : BOOLEAN);
-
- Cursor (off);
- Cursor (on);
-
- DESCRIPTION
- If the parameter is false, then the cursor will be turned off, if the
- parameter is true then the cursor will be turned back on.
-
- SEE ALSO
-
- DEPENDS ON
-
- DIAGNOSTICS
-
- KNOWN RESTRICTIONS
- This routine may not work with all manufactures of the display card.
-
- PARTIALLY OBSOLETED BY
-
- UPDATE HISTORY
-
-
- NAME
- .K:CursorInsertSize - Changes to cursor to a fat line.
- CursorInsertSize - Changes to cursor to a fat line.
-
-
- SYNOPSIS
- PROCEDURE CursorInsertSize;
-
- CursorInsertSize;
-
- DESCRIPTION
- This routine changes the cursor to a fat line. This is typically used
- in screen oriented programs to select insert versus overwrite mode.
-
- SEE ALSO
- CursorOverwriteMode
-
- DEPENDS ON
-
- DIAGNOSTICS
-
- KNOWN RESTRICTIONS
-
- PARTIALLY OBSOLETED BY
-
- UPDATE HISTORY
-
-
- NAME
- .K:CursorOverwriteSize - Changes the cursor to a normal line.
- CursorOverwriteSize - Changes the cursor to a normal line.
-
- SYNOPSIS
- PROCEDURE CursorOverwriteSize;
-
- CursorOverwriteSize;
-
- DESCRIPTION
- Changes the cursor to the normal size underline. This is typically used
- in screen oriented programs to select overwrite versus insert mode.
-
- SEE ALSO
- CursorInsertMode
-
- DEPENDS ON
-
- DIAGNOSTICS
-
- KNOWN RESTRICTIONS
-
- PARTIALLY OBSOLETED BY
-
- UPDATE HISTORY
-
-
- NAME
- .K:ScrBackCursorColor - Return the background color of cursor.
- ScrBackCursorColor - Return the background color of cursor.
-
- SYNOPSIS
- FUNCTION ScrBackCursorColor : INTEGER;
-
- FColor := ScrBackCursorColor;
-
- DESCRIPTION
- ScrBackCursorColor returns the color value (0 - 7) of the on screen
- cursor.
-
- SEE ALSO
- ScrForeCursorColor.
-
- DEPENDS ON
-
- DIAGNOSTICS
-
- KNOWN RESTRICTIONS
-
- PARTIALLY OBSOLETED BY
-
- UPDATE HISTORY
-
-
- NAME
- .K:ScrForeCursorColor - Return the foreground color of cursor.
- ScrForeCursorColor - Return the foreground color of cursor.
-
- SYNOPSIS
- FUNCTION ScrForeCursorColor : WORD;
-
- FColor := ScrForeCursorColor;
-
- DESCRIPTION
- ScrForeCursorColor returns the color value (0 - 15) of the on screen
- cursor.
-
- SEE ALSO
- ScrBackCursorColor
-
- DEPENDS ON
-
- DIAGNOSTICS
-
- KNOWN RESTRICTIONS
-
- PARTIALLY OBSOLETED BY
-
- UPDATE HISTORY
-
-
- .K:5) VIDEO MESSAGES
- 5) VIDEO MESSAGES
-
- NAME
- .K:Pause - Debugging aid whichs waits for a key to be pressed.
- Pause - Debugging aid whichs waits for a key to be pressed.
-
- SYNOPSIS
- PROCEDURE Pause;
-
- WRITELN ('Starting calculations');
- Pause;
-
- DESCRIPTION
- This routine will print a flashing character in the lower left corner
- of the screen and wait for a key to be pressed. Once a key has been
- pressed the flashing character will be removed, and the character that
- was there originally will be restored. The routine works with either
- the monochrome or the color monitor.
-
- SEE ALSO
-
- DEPENDS ON
-
- DIAGNOSTICS
-
- KNOWN RESTRICTIONS
- If Sidekick is invoked while on a screen with flashing characters, the
- characters will not flash upon exit of sidekick.
-
- PARTIALLY OBSOLETED BY
-
- UPDATE HISTORY
-
-
- NAME
- .K:Wait - Displays a flashing WAIT message in the lower right of screen.
- Wait - Displays a flashing WAIT message in the lower right of screen.
-
- SYNOPSIS
- PROCEDURE Wait (DispWait : BOOLEAN);
-
- Wait (On);
- Wait (Off);
-
- DESCRIPTION
- When called with a TRUE value, or On, the contents on the last four
- spaces of the screen are saved and a flashing WAIT message appears. When
- called with the value FALSE, or Off, the WAIT message is removed and the
- orginal contents restored. The routine works with either the monochrome or
- the color monitor.
-
- SEE ALSO
-
- DEPENDS ON
-
- DIAGNOSTICS
-
- KNOWN RESTRICTIONS
- If Sidekick is invoked while on a screen with flashing characters, the
- characters will not flash upon exit of sidekick.
-
- PARTIALLY OBSOLETED BY
-
- UPDATE HISTORY
-
-
- NAME
- .K:ScrErrMsg - Prints an error message on the 25th line.
- ScrErrMsg - Prints an error message on the 25th line.
-
- SYNOPSIS
- PROCEDURE ScrErrMsg (Message : MaxStr);
-
- ScrErrMsg ('You must enter a value between 1 and 12');
-
- DESCRIPTION
- This procedure will print the string message (the first 64 characters
- only) on the 25th line of the screen. It will then sound the beep,
- and then print ' Press <Enter> '. It then waits for the user to press
- the enter key after which the 25th line is cleared and control
- returns to the program.
-
- The message is displayed in the D_ErrColor, which has a default color
- of light (bright) red.
-
- SEE ALSO
- ScrStatMsg
-
- DEPENDS ON
-
- DIAGNOSTICS
-
- KNOWN RESTRICTIONS
-
- PARTIALLY OBSOLETED BY
-
- UPDATE HISTORY
-
-
-
- NAME
- .K:ScrStatMsg - Prints a status message on the 25th line.
- ScrStatMsg - Prints a status message on the 25th line.
-
- SYNOPSIS
- PROCEDURE ScrStatMsg (Message : STRING);
-
- ScrStatMsg ('Record deleted, file will be updated.');
-
- DESCRIPTION
- This procedure prints out the Message string on the 25th line of the
- screen. Only the first 76 characters of the string are printed.
- There is no delay and no bell. Control is returned to the program and
- the message remains on the 25th line.
-
- The message is displayed in the D_StatColor which has a default color
- of green.
-
- SEE ALSO
- ScrErrMsg
-
- DEPENDS ON
-
- DIAGNOSTICS
-
- KNOWN RESTRICTIONS
-
- PARTIALLY OBSOLETED BY
-
- UPDATE HISTORY
-
-
-
- NAME
- .K:ScrYouAreSure - Asks user to verify operation.
- ScrYouAreSure - Asks user to verify operation.
-
- SYNOPSIS
- FUNCTION ScrYouAreSure (Message : STRING) : BOOLEAN;
-
- IF ScrYouAreSure ('Delete this record') THEN Delete;
-
- DESCRIPTION
- This procedure prints the message at the bottom of the current screen
- and waits for a key press. The message is inserted into the text:
- 'Hit any key to '+message+' or hit <Enter> to CANCEL.' A message of
- null string will cause the message to be replaced with the word
- 'CONTINUE'. If the user presses the ESC key then the function returns
- the value FALSE, while any other key returns the value TRUE.
-
- The message is displayed in the D_StatColor which has a default color of
- green.
-
- SEE ALSO
- ScrYN
-
- DEPENDS ON
-
- DIAGNOSTICS
-
- KNOWN RESTRICTIONS
- If your message is longer than 60 characters, part of it will be lost
- off the right side of the screen.
-
- PARTIALLY OBSOLETED BY
-
- UPDATE HISTORY
-
-
-
- NAME
- .K:ScrYN - Asks user to verify operation
- ScrYN - Asks user to verify operation
-
- SYNOPSIS
- FUNCTION ScrYN (Message : STRING) : BOOLEAN;
-
- IF ScrYN ('Delete this record') THEN Delete;
-
- DESCRIPTION
- This procedure prints the message at the bottom of the current screen
- and waits for a key press. The message is inserted into the text:
- Message + ' (Y/N)? ' A message of null string will cause the message
- to be replaced with the words 'Are You Sure'. If the user presses the
- 'N' or 'n' key then the function returns the value FALSE, if the user
- pressed the 'Y' or 'y' key then the function returns the value TRUE.
- Any other keystroke will be ignored.
-
- The message is displayed in the D_StatColor which has a default color of
- green.
-
- SEE ALSO
- ScrYouAreSure
-
- DEPENDS ON
-
- DIAGNOSTICS
-
- KNOWN RESTRICTIONS
- If your message is longer than 66 characters, part of it will be lost
- off the right side of the screen.
-
- PARTIALLY OBSOLETED BY
-
- UPDATE HISTORY
-
-
-
- .K:6) DISK AND MEMORY SIZES
- 6) DISK AND MEMORY SIZES
-
- NAME
- .K:BytesOnDiskFree - Calculate number of bytes remaining on a disk drive.
- BytesOnDiskFree - Calculate number of bytes remaining on a disk drive.
-
- SYNOPSIS
- FUNCTION BytesOnDiskFree (Drive : CHAR) : LONGINT;
-
- WRITELN(BytesOnDiskFree('C'));
-
- DESCRIPTION
- This routine returns the number of bytes remaining on the specified
- drive, just the DOS CHKDSK command. If the parameter supplied is a
- blank, the default drive is used.
-
- SEE ALSO
-
- DEPENDS ON
-
- DIAGNOSTICS
- If the drive specified isn't in the range of A to Z, or blank, then
- this routine returns -1.
-
- KNOWN RESTRICTIONS
-
- PARTIALLY OBSOLETED BY
- DiskFree
-
- UPDATE HISTORY
-
-
-
- NAME
- .K:FreeDOSMem - Returns the amount of currently unused RAM memory.
- FreeDOSMem - Returns the amount of currently unused RAM memory.
-
- SYNOPSIS
- FUNCTION FreeDOSMem : LONGINT;
-
- WRITELN ('You have this much RAM free: ', FreeDOSMem);
-
- DESCRIPTION
- FreeDOSMem returns the amount of RAM memory installed currently
- unsed. This avoids a length invokation of CHKDSK to return this
- information. This routine is handy for checking how much space is left
- before spawning a child process.
-
- SEE ALSO
-
- DEPENDS ON
-
- DIAGNOSTICS
-
- KNOWN RESTRICTIONS
-
- PARTIALLY OBSOLETED BY
-
- UPDATE HISTORY
-
-
-
- NAME
- .K:SizeOfMem - Returns the amount of RAM memory installed.
- SizeOfMem - Returns the amount of RAM memory installed.
-
- SYNOPSIS
- FUNCTION SizeOfMem : LONGINT;
-
- WRITELN ('You have Installed: ', SizeOfMem);
-
- DESCRIPTION
- SizeOfMem returns the amount of RAM memory installed using the
- BIOS call to report this information.
-
- SEE ALSO
-
- DEPENDS ON
-
- DIAGNOSTICS
-
- KNOWN RESTRICTIONS
- This routine may not work if your DIP switchs are set improperly
- (like they are when you are running a more-ram-than-switches program
- on the old style PC's)
-
- PARTIALLY OBSOLETED BY
-
- UPDATE HISTORY
-
-
- NAME
- .K:StackAvail - Returns the amount of stack space remaining in bytes.
- StackAvail - Returns the amount of stack space remaining in bytes.
-
-
- SYNOPSIS
- FUNCTION StackAvail : WORD;
-
- WRITELN ('Stack left: StackAvail);
-
- DESCRIPTION
- StackAvail reports the amount of free stack space remaining. The
- maximum stack space is 64K.
-
- SEE ALSO
-
- DEPENDS ON
- LongAddr
-
- DIAGNOSTICS
-
- KNOWN RESTRICTIONS
-
- PARTIALLY OBSOLETED BY
-
- UPDATE HISTORY
-
-
- .K:7) INSTRUCTION TIMING
- 7) INSTRUCTION TIMING
-
- NAME
- .K:TimeElapsed - Returns the number of seconds elapsed since genesis.
- TimeElapsed - Returns the number of seconds elapsed since genesis.
-
- SYNOPSIS
- FUNCTION TimeElapsed : REAL;
-
- StartTime := TimeElapsed;
-
- DESCRIPTION
- This routine reads the low level DOS timer of seconds elapsed since
- 1/1/80. It returns a real number value in seconds with a decimal
- portion for centiseconds. Since the internal clock tick is 18.2 times
- a second, there is no loss of precision in the value returned.
- TimeElapsed is used primarily for setting up timing tests.
-
- SEE ALSO
-
- DEPENDS ON
-
- DIAGNOSTICS
-
- KNOWN RESTRICTIONS
-
- PARTIALLY OBSOLETED BY
-
- UPDATE HISTORY
-
-
-
- NAME
- .K:TimeTotal - Returns the value of a timing test as a formatted string.
- TimeTotal - Returns the value of a timing test as a formatted string.
-
-
- SYNOPSIS
- FUNCTION TimeTotal (StartTime, StopTime : REAL) : STRING;
-
- StartTime := TimeElapsed;
- FOR Ctr := 1 TO MAXINT DO ...
- StopTime := TimeElapsed;
-
- WRITELN(TimeTotal(StartTime,StopTime));
-
-
- DESCRIPTION
- This routine takes two real numbers and subtracts them to return a
- timing loop value.
-
- SEE ALSO
- TimeElapsed
-
- DEPENDS ON
- Strip
- R2S
-
- KNOWN RESTRICTIONS
-
- PARTIALLY OBSOLETED BY
-
- UPDATE HISTORY
-
-
- .K:8) GENERAL PURPOSE FILE
- 8) GENERAL PURPOSE FILE
-
- NAME
- .K:Exist - Test if a file exists (R/W access).
- Exist - Test if a file exists (R/W access).
-
- SYNOPSIS
- FUNCTION Exist (FileName: STRING) : BOOLEAN;
-
- IF NOT Exist ('\COMMAND.COM') THEN HALT;
-
- DESCRIPTION
- This is the 'classic' exist function found as found in various Turbo
- Manuals.
-
- SEE ALSO
- ReadOnlyExist
-
- DEPENDS ON
-
- DIAGNOSTICS
-
- KNOWN RESTRICTIONS
- Assumes Read/Write access to the file; if the file is marked Read Only,
- this routine will incorrectly report the file as non-existant.
-
- PARTIALLY OBSOLETED BY
-
- UPDATE HISTORY
-
-
-
- NAME
- .K:LinesInFile - Returns the number of lines in a text file.
- LinesInFile - Returns the number of lines in a text file.
-
- SYNOPSIS
- FUNCTION LinesInFile (FileName : STRING) : INTEGER;
-
- WRITELN (LinesInFile ('YourFile.TXT'));
-
- DESCRIPTION
- Returns an integer number of lines in a text file. The text file is
- opened for reading (RESET), the entire file is scanned and the
- number of lines within the file is returned.
-
- SEE ALSO
-
- DEPENDS ON
- Exist
-
- DIAGNOSTICS
- If the file does not exist, then the number of lines returned
- will be -1.
-
- KNOWN RESTRICTIONS
- This routine will report read-only files as non-existant.
-
- PARTIALLY OBSOLETED BY
-
- UPDATE HISTORY
-
-
- NAME
- .K:GetFileDateAndTimeString - Get file directory date and time.
- GetFileDateAndTimeString - Get file directory date and time.
-
- SYNOPSIS
- FUNCTION GetFileDateAndTimeString (FileName : STRING) : STRING;
-
- WRITELN (GetFileDateAndTimeString ('\COMMAND.COM'));
-
- DESCRIPTION
- Returns a string with the date and time assigned by DOS to the file
- passed as the parameter. Full path and file names are allowed. The file
- does not have to open.
-
- SEE ALSO
- GetFileDateAndTimeLongInt
-
- DEPENDS ON
- I2S
-
- DIAGNOSTICS
- If the name passed does not exist, an error message is passed back
- instead of the date and time.
-
- KNOWN RESTRICTIONS
- This routine will report read-only files as non-existant.
-
- PARTIALLY OBSOLETED BY
- GetFTime and UnPackTime
-
- UPDATE HISTORY
-
-
- NAME
- .K:GetFileDateAndTimeLongInt - Get file directory date and time.
- GetFileDateAndTimeLongInt - Get file directory date and time.
-
- SYNOPSIS
- FUNCTION GetFileDateAndTimeLongInt (FileName : STRING) : LONGINT;
-
- IF GetFileDateAndTimeLongInt ('C:\PROGRAM.EXE') >
- GetFileDateAndTimeLongInt ('D:\PROGRAM.EXE') THEN ...
-
- DESCRIPTION
- Returns a long integer with the date and time assigned by DOS to the file
- passed as the parameter. Full path and file names are allowed. The
- numeric value returned by this routine make timestamp comparisons between
- files easy. The file does not have to be open.
-
- SEE ALSO
- GetFileDateAndTimeString
-
- DEPENDS ON
-
- DIAGNOSTICS
- If the name passed does not exist, -1 is returned.
-
- KNOWN RESTRICTIONS
- This routine will report read-only files as non-existant.
-
- PARTIALLY OBSOLETED BY
- GetFTime
-
- UPDATE HISTORY
-
-
- .K:9) MATH
- 9) MATH
-
- NAME
- .K:Power - Raise a Real number to a Real exponent.
- Power - Raise a Real number to a Real exponent.
- .K:Log - Return the base 10 log of a real number.
- Log - Return the base 10 log of a real number.
-
- SYNOPSIS
- FUNCTION Power (X, Y : REAL) : REAL;
- FUNCTION Log (X : REAL) : REAL;
-
- WRITELN (Power (2,3):3);
- WRITELN (Log (100));
-
- DESCRIPTION
- Power will raise the first parameter to the power of the second. In
- the above example 2 raised 3 is 8.
-
- Log returns the log base 10 of the number. In the above example, the
- log base 10 of 100 is 2.
-
- SEE ALSO
-
- DEPENDS ON
-
- DIAGNOSTICS
-
- KNOWN RESTRICTIONS
- These routines will not work with the turbo BCD compiler since the BCD
-
- PARTIALLY OBSOLETED BY
-
- UPDATE HISTORY
-
-
-
- .K:10) DOS AND ENVIRONMENT
- 10) DOS AND ENVIRONMENT
-
- NAME
- .K:DOSVersionR - Returns the DOS version number.
- DOSVersionR - Returns the DOS version number.
-
- SYNOPSIS
- FUNCTION DOSVersionR : REAL;
-
- IF DOSVersionR < 3.1 THEN HALT;
-
- DESCRIPTION
- Returns a real number containing the DOS version number.
-
- SEE ALSO
-
- DEPENDS ON
-
- DIAGNOSTICS
-
- KNOWN RESTRICTIONS
- If the DOS version number is less than DOS 2.0, the routine will return
- DOS 1.1 even if the version is DOS 1.0
-
- PARTIALLY OBSOLETED BY
- DosVersion
-
- UPDATE HISTORY
-
-
-
- NAME
- .K:WhoAmI - Return the name of the currently executing program
- WhoAmI - Return the name of the currently executing program
-
- SYNOPSIS
- FUNCTION WhoAmI : STRING;
-
- WRITELN(WhoAmI)
-
- DESCRIPTION
- This routine returns the full path name of the currently executing
- program. If this program has been chained, the immediate parent, as
- opposed to the original parent, is returned.
-
- SEE ALSO
-
- DEPENDS ON
- DosVersionR, DOS 3.X and higher.
-
- DIAGNOSTICS
- This routine will return the null string if the currently used version
- of DOS is lower than 3.X.
-
- KNOWN RESTRICTIONS
-
- PARTIALLY OBSOLETED BY
- ParamStr(0)
-
- UPDATE HISTORY
-
-
-
- NAME
- .K:GetEnvString - Return the value of an environment variable.
- GetEnvString - Return the value of an environment variable.
-
- SYNOPSIS
- FUNCTION GenEnvString (EnvVar : STRING) : STRING;
-
- WRITELN(GenEnvString('PATH = ');
-
- DESCRIPTION
- This function returns the value of the specified environment string. The
- equal sign must be included. The parameter need not be upper case, or
- have blanks striped out.
-
- SEE ALSO
-
- DEPENDS ON
-
- DIAGNOSTICS
-
- KNOWN RESTRICTIONS
-
- PARTIALLY OBSOLETED BY
- EnvStr - Actually totally obsolete but GetEnvString is such a 'nice'
- piece of code it remains for at least eductaional purposes.
-
- UPDATE HISTORY
-
-
-
- .K:11) VERSION CONTROL
- 11) VERSION CONTROL
-
- NAME
- .K:GetDMLVersion - Get individual module version number.
- GetDMLVersion - Get individual module version number.
-
- SYNOPSIS
- FUNCTION GetDMLVersion(Module : WORD) : STRING;
-
- WRITELN(GetDMLVersion(1));
-
- DESCRIPTION
- Returns a string of version number of an individual DML UNIT. The string
- is formatted as a real number 'xx.xx'. The module numbers are:
- 0) DML (overall library)
- 1) GEN
- 2) NUM
- 3) STRG
- 4) KBD
- Any parameter value larger than 4 returns the overall version number.
-
- SEE ALSO
- GetDMLVersions
-
- DEPENDS ON
-
- DIAGNOSTICS
-
- KNOWN RESTRICTIONS
-
- PARTIALLY OBSOLETED BY
-
- UPDATE HISTORY
-
-
- NAME
- .K:GetDMLVersions - Get all module version numbers.
- GetDMLVersions - Get all module version numbers.
-
- SYNOPSIS
- FUNCTION GetDMLVersions : STRING;
-
- WRITELN(GetDMLVersions);
-
- DESCRIPTION
- Returns a string of all the version numbers for the DML UNITs.
- The module versions returned are for:
- 0) DML (overall library)
- 1) GEN
- 2) NUM
- 3) STRG
- 4) KBD
-
- SEE ALSO
- GetDMLVersion
-
- DEPENDS ON
- GetDMLVersion
-
- DIAGNOSTICS
-
- KNOWN RESTRICTIONS
-
- PARTIALLY OBSOLETED BY
-
- UPDATE HISTORY
-
-
-